﻿#pragma once
#include"SMTData.h"
#include<opencv2/opencv.hpp>
#include<vector>
#include<string>

class QByteArray;
class SMTImage;
class QImage;
class QByteArray;


static const std::string base64_chars =
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz"
"0123456789+/";

static inline bool is_base64(unsigned char c);

int base64toImgResize(std::string base64, SMTImage* baseImg, int height, int widght);

QByteArray SmtImagetoBase64(SMTImage* pImage, QImage& packImage, int imageQuality = 20);
QByteArray SmtImagetoBase64(SMTImage* pImage, int imageQuality = 100);
SMTImage Base64toSmtImage(QByteArray* hexed);
bool QImageToSmtImage(const QImage& qImage, SMTImage* pImage);
bool SMTImageToQImage(SMTImage* smtImage, QImage& image);

